import request from '../utils/request'

//获取帖子分页列表数据
export function listPost(query){
    return request({
        url:'/admin/post/list',
        method:'get',
        params:query
    })
}
//获取帖子信息
export function getPost(id){
    return request({
        url:'/admin/post/'+id,
        method:'get'
    })
}

//修改帖子信息
export function updatePost(data){
    return request({
        url:'/admin/post/update',
        method:'put',
        data:data
    })
}

//新增用户
export function addPost(data){
    return request({
        url:'/admin/post/add',
        method:'post',
        data:data
    })
}

//删除用户
export function delPost(id){
    return request({
        url:'/admin/post/' +  id,
        method:'delete'
    })
}

export function getPostCount(userId){
    return request({
        url:'/admin/post/selectPostCount',
        method:'get',
        params:{
            "userId":userId
        }
    })
}